package com.zjj.learn.algorithmPlus.segment1.blockQueue;

/**
 * @author zjj_admin
 */
public interface BlockingQueue<E> {

    /**
     * 无限期阻塞添加一个数据
     *
     * @param value
     * @throws InterruptedException
     */
    void offer(E value) throws InterruptedException;

    /**
     * 限时阻塞添加一个数据，超时返回 null
     *
     * @param value
     * @param timeout
     * @throws InterruptedException
     */
    void offer(E value, long timeout) throws InterruptedException;

    /**
     * 无限期阻塞添加数据
     *
     * @return
     * @throws InterruptedException
     */
    E poll() throws InterruptedException;
}
